package com.gs.wechatdemo.control;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

public class OnRecyclerViewScrollListener extends RecyclerView.OnScrollListener implements OnScrollListener {

    @Override
    public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
        super.onScrollStateChanged(recyclerView, newState);
        if (newState == RecyclerView.SCROLL_STATE_IDLE) {
            if (!recyclerView.canScrollVertically(1)) {
                onBottom();
            } else if (!recyclerView.canScrollVertically(-1)) {
                onTop();
            }
        }
    }

    @Override
    public void onTop() {

    }

    @Override
    public void onBottom() {

    }
}
